On the right you can see my final program in all its glory. Some points to note:

I get a random effect by repeatedly calling the random function (and ignoring the result) while I wait for the user to press the button down. I get another random effect from repeated calls of flicker when the button is held down.

Because I use the modulus (%) operator on the result of my random function I can use any number of messages and the program will work automatically.
Exercise 6.5